/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.customer.core.repository.entity;

import com.gitee.peigenlpy.actable.annotation.Column;
import com.gitee.peigenlpy.actable.annotation.Index;
import com.gitee.peigenlpy.actable.annotation.Table;
import com.gitee.peigenlpy.actable.annotation.Unique;
import com.gitee.peigenlpy.actable.constants.MySqlCharsetConstant;
import com.gitee.peigenlpy.actable.constants.MySqlEngineConstant;
import com.gitee.peigenlpy.actable.constants.MySqlTypeConstant;
import info.peigen.hotpot.business.customer.facade.enums.auth.*;
import info.peigen.hotpot.common.core.enums.CertType;
import info.peigen.hotpot.component.data.repository.beetlsql.entity.AbstractCreateTimeEntity;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

/**
 * <b>(CustomerAuthenticationEntity)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/2
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Table(name = "customer_authentication", comment = "客户实名认证表", charset = MySqlCharsetConstant.UTF8MB4, engine = MySqlEngineConstant.InnoDB)
@org.beetl.sql.annotation.entity.Table(name = "customer_authentication")
public class CustomerAuthenticationEntity extends AbstractCreateTimeEntity {
    @Column(name = "customer_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "customerId")
    @Unique(value = "customerId", columns = "customer_id")
    @org.beetl.sql.annotation.entity.Column("customer_id")
    String              customerId;
    @Column(name = "customer_cert_subject", type = MySqlTypeConstant.VARCHAR, length = 40, isNull = false,
            comment = "客户认证主体;Personal:个人,Enterprise:企业")
    @Index(value = "certSubject", columns = "customer_cert_subject")
    @org.beetl.sql.annotation.entity.Column("customer_cert_subject")
    CustomerCertSubject customerCertSubject;

    @Column(name = "customer_cert_status", type = MySqlTypeConstant.VARCHAR, length = 40, isNull = false,
            comment = "认证状态;CERT_INIT:未实名认证,CERT_AUDITING:实名审核中,CERT_PASS:实名认证通过,CERT_REFUSE:实名认证拒绝,CERT_PASTING:证件即将过期,CERT_PAST:证件已到期")
    @Index(value = "certStatus", columns = "customer_cert_status")
    @org.beetl.sql.annotation.entity.Column("customer_cert_status")
    CustomerCertStatus customerCertStatus;

    @Column(name = "customer_cert_type", type = MySqlTypeConstant.VARCHAR, length = 100, isNull = false, comment = "证件类型")
    @Index(value = "certType", columns = "customer_cert_type")
    @org.beetl.sql.annotation.entity.Column("customer_cert_type")
    CertType customerCertType;

    @Column(name = "customer_cert_method", type = MySqlTypeConstant.VARCHAR, length = 20, isNull = false,
            comment = "认证方式;T:默认,G:担保认证,EX:急速认证")
    @Index(value = "certMethod", columns = "customer_cert_method")
    @org.beetl.sql.annotation.entity.Column("customer_cert_method")
    CustomerCertMethod customerCertMethod;

    @Column(name = "customer_cert_role", type = MySqlTypeConstant.VARCHAR, length = 40, comment = "认证角色;Legal_Representative:法定代表人,Enterprise_Partner:企业董事/实际控制人/股东,Enterprise_Licensor:被授权人")
    @org.beetl.sql.annotation.entity.Column("customer_cert_role")
    CustomerCertRole customerCertRole;

    @Column(name = "level", type = MySqlTypeConstant.VARCHAR, length = 20, isNull = false,
            comment = "认证等级;V:贵宾,T:普通,P:存疑")
    @Index(value = "certLevel", columns = "level")
    @org.beetl.sql.annotation.entity.Column("level")
    CustomerCertLevel level;

    @Column(name = "memo", type = MySqlTypeConstant.VARCHAR, length = 200, comment = "备注")
    @org.beetl.sql.annotation.entity.Column("memo")
    String memo;
}